<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>PDF Created</title>

        <style type="text/css">

            body {
                background-color: #fff;
                margin: 40px;
                font-family: Lucida Grande, Verdana, Sans-serif;
                font-size: 14px;
                color: #4F5155;
            }

            a {
                color: #003399;
                background-color: transparent;
                font-weight: normal;
            }

            h1 {
                color: #444;
                background-color: transparent;
                border-bottom: 1px solid #D0D0D0;
                font-size: 16px;
                font-weight: bold;
                margin: 24px 0 2px 0;
                padding: 5px 0 6px 0;
            }

            code {
                font-family: Monaco, Verdana, Sans-serif;
                font-size: 12px;
                background-color: #f9f9f9;
                border: 1px solid #D0D0D0;
                color: #002166;
                display: block;
                margin: 14px 0 14px 0;
                padding: 12px 10px 12px 10px;
            }

            table {
                width: 100%;
                border: 1px;
            }
            table th {
                font-weight: bold;
                padding: 4px;
                font-size: 1.2em;
                border-bottom: 1px solid #000;
            }
            table td {
                padding: 6px;
                border-bottom: 1px dotted #efefef;
            }

        </style>
    </head>
    <body>
                        <?php if($bulan=="NULL"){?>
                       <h2 class="title">Data Promote Out Manager</h2>
                       <?php }else{ ?>
                       <h2 class="title">Data Promote Out Manager per Bulan <?php echo $nama_bulan." Tahun : " . $tahun?></h2>
                       <?php } ?>
                       <p>&nbsp;</p>
                        <table width="100%" border="1" cellpadding="1" cellspacing="1" align="center">

                            <thead>

                                <tr align="center">
                                    <th >No</th>
                                    <th >Nama Manager</th>
                                    <th>Mother Manager</th>
                                    <th >Unit Baru</th>
                                    <th >Manager Khusus</th>
                                    <th>Bulan</th>
                                    <th>Sales</th>
                                    <th>PV</th>
                                    <th>Kota</th>
                              
                                </tr>
                            </thead>
                            <tbody>

                                <!-- ============isi ============ -->

                                <?php
                                if(!empty($pra_cm)) {
                                    $i=1;
                                    foreach($pra_cm as $m) :
                                    if($m->cm_khusus==1){
                                        $c = "Satu Bulan";
                                    }elseif($m->cm_khusus==2){
                                        $c = "Dua Bulan";
                                    }else{

                                        $c = "Tiga Bulan";
                                    }
                                        ?>
                                <tr align='center'>
                                    <td ><?php echo $i++; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->strnama_dealer; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->strnama_upline; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->strnama_unit; ?></td>
                                    <td align='left'>&nbsp;<?php echo $c; ?></td>
                                    <td align='left'>&nbsp;<?php echo date('F',strtotime($m->tanggal)); ?></td>

                                    <td align='left'>&nbsp;<?php echo $m->total_omset; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->total_pv; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->cabang; ?></td>
                                  
                                </tr>
                                    <?php
                                    endforeach;
                                }else {
                                    ?>
                                <tr>
                                    <td colspan="10" align="center">
                                        No Data Display
                                    </td>
                                </tr>
                                    <?php } ?>

                            </tbody>
                        </table>
          
    </body>
</html>

